/*
 * Copyright 2006-2007 the original author or authors.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package sant

import com.google.code.sant._
import com.google.code.sant.{supertask => st}

/**
 * @author Stepan Koltsov
 * @author Sergey Nebolsin
 */
object Predef {
  
  val Ant = com.google.code.sant.Ant
  def project = Ant.project
  
  def target(name: String, args: AntParam*)(p: => Unit) = project.target(name, args: _*)(p)
  
  def log(message:String) = project.info(message)  

  def load(scriptName:String) = project.load(scriptName)
  
  // types
  
  def fileset = Ant.fileset
  
  def path = Ant.path
  
  // nested elements
  
  class NestedElementsFactory(name: String) {
    def apply(args: AntParam*) = new NestedElementAntParam(name, args: _*)
  }
  
  def nested(name: String) = new NestedElementsFactory(name)
  
  def include = nested("include")
  def exclude = nested("exclude")
  
  def classpath = nested("classpath")
  
  implicit def filenameToFile(s: String): java.io.File = new java.io.File(s)
  
  val Copy = st.Copy
  
  val FileSet = st.FileSet
  
  type File = java.io.File
}
